package com.minmin.common;

import java.io.File;

public class BaseUrl {
    public String getBaseUrl() {
        File file = new File(this.getClass().getResource("/").toString());
        String baseUrl = getBaseUrl(file.toString()).substring(6);
        return baseUrl;
    }

    private String getBaseUrl(String fileUrl) {
        File file = new File(fileUrl);
        String baseUrl = file.getParent();
        if (!new File(baseUrl).getName().equals("work_space")) {
            return getBaseUrl(baseUrl);
        }
        return baseUrl;
    }
}
